using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Objects;
using DAL;
using System.Collections.Generic;

public partial class Customer_UCControls_UCKhachHangNhanTheKhac : System.Web.UI.UserControl
{
 public static DangKy ItemDangKy = new DangKy();
    protected void Page_Load(object sender, EventArgs e)
    {
       
           ItemDangKy = (DangKy)Session["ItemDangKy"];
    }
    protected void bntInsert_Click(object sender, EventArgs e)
    {
        KhachHangNhanTheKhac ItemKhachHangNhanTheKhac = new KhachHangNhanTheKhac();

        ItemKhachHangNhanTheKhac.NguoiNhan = txtNguoiNhan.Text;
        ItemKhachHangNhanTheKhac.SoDienThoai = txtSoDienThoai.Text;
        ItemKhachHangNhanTheKhac.DiaChi = txtDiaChi.Text;
        ItemKhachHangNhanTheKhac.ThongDiep = txtThongDiep.Text;
        ItemKhachHangNhanTheKhac.GhiChu = "";

        BAL.BALKhachHangNhanTheKhac.Insert(ItemKhachHangNhanTheKhac);

        ItemKhachHangNhanTheKhac = BAL.BALKhachHangNhanTheKhac.GeMaxId();

        ItemDangKy.IdKhachHangNhanTheKhac = ItemKhachHangNhanTheKhac.Id;

          Duyet ItemDuyet = new Duyet();
        ItemDuyet.TrangThaiDuyet = -1;
        ItemDuyet.IdNguoiDung = -1;
        ItemDuyet.IdDangKy = ItemDangKy.Id;
        ItemDuyet.NgayDuyet = DateTime.MinValue;
        ItemDuyet.GhiChu = "";

    }
}
